﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Bll;
using System.Web.Security;

public partial class admin : System.Web.UI.Page
{
    AdminBLL bll = new AdminBLL();
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void lbtnlogin_Click(object sender,EventArgs e)
    {
        string admin = txtadmin.Text;
        string adminpwd = FormsAuthentication.HashPasswordForStoringInConfigFile(txtpwd.Text,"MD5");
        if (bll.adminlogin(admin, adminpwd) == 1)
        {  
            Session["usergroup"] = "admin";
            Session["username"] = "admin";
            Session["userid"] = "admin";
            Response.Redirect("Default.aspx");
            
        }
        else
        {
            Response.Write("<script type='text/javascript'>alert('用户民或密码错误！');</script>");
        }

    }
}